﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IceDog.UpdateDB.Model
{
    /// <summary>
    /// 基础模型
    /// <para>基础模型，只有ModelID,ModelGuid,Remark三个属性</para>
    /// </summary>
    /// <remarks>基础模型，只有ModelID,ModelGuid,Remark三个属性</remarks>
    public class BaseModel
    {
        public BaseModel()
        {
            this.ModelGuid = Guid.NewGuid().ToString("N");
        }
        /// <summary>
        /// 模型ID(自动生成,无需赋值)
        /// </summary>
        /// <remarks>这里不直接用ID,是考虑ID在oracle中是关键字</remarks>
        [Key]//主键
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]//自增
        public int ModelID { get; set; }
        /// <summary>
        /// 模型Guid(自动生成,无需赋值)
        /// </summary>
        public string ModelGuid { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }
}
